<?php
class stFlickrToolboxFunctions extends stfunctions_2_1{
	
        public function __construct($config){
            parent::__construct($config);
	}

        public function flickrSaveToken($frob) {
            require_once $this->config['pluginDir'].'stFlickrToolboxclass.php';
            $stFlickrToolbox = new stFlickrToolboxclass($this->config, $this->option);
            $flickr_token = $stFlickrToolbox->getAccessToken($frob);
//            echo $flickr_token;
            $data['flickr_token'] = $flickr_token["token"];
            $this->updateOption($data);
	}

        public static function limitWords($mycontent, $limit = 10){
            $mycontent = strip_shortcodes($mycontent);
            $mycontent = str_replace(']]>', ']]&gt;', $mycontent);
            $mycontent = strip_tags($mycontent);
            $excerpt_length = $limit;
            $words = explode(' ', $mycontent, $excerpt_length + 1);
            if(count($words) > $excerpt_length) :
                    array_pop($words);
                    array_push($words, '...');
                    $mycontent = implode(' ', $words);
            endif;
            return $mycontent;
        }
       

}
?>